import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/login',
    component: Home
  },
  {
    path: '/login',
    name: 'Login',
    component:()=>import('@/pages/login.vue')
   
  },
  {
    path:'/manager',
    component:()=>import('@/pages/manager.vue'),
    children: [
      {
        path:'home',
        component:()=>import('@/pages/home.vue')
      },
      {
        path:'order',
        component:()=>import('@/pages/order.vue')
      },
      {
        path:'income',
        component:()=>import('@/pages/income.vue')
      },
      {
        path:'user',
        component:()=>import('@/pages/user.vue')
      }
    ]
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
